<?php 
class cls_control_comment extends cls_control_base
{
	function add_comment()
	{
		$comment_serve = cls_serve_base::get_instance($this->name);
		if(!isset($_COOKIE['b2c_customerid']))
		{
			$notlogin = return_info(false, "登录超时");
			echo json_encode($notlogin);
			return;
		}
		$customerid = $_COOKIE['b2c_customerid'];
		$productid = $_POST['productid'];
		$productcomment = $_POST['productcomment'];
		$imagepath = "";
		
		$productid = mysql_real_escape_string($productid);
		$productcomment = mysql_real_escape_string($productcomment);
		$imagepath = mysql_real_escape_string($imagepath);
		
		$result = $comment_serve->add_comment($customerid, $productid, $productcomment, $imagepath);
		
		echo json_encode($result);
	}
}
?>